let mysql      = require('mysql');
let connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : '123456',
});

connection.connect();
//创建表，将默认的utf8改为utf8mb4
connection.query('CREATE DATABASE IF NOT EXISTS chen DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_520_ci;', function (error, results, fields) {
  if (error) throw error;
});

connection.end();